bitkeeper revision 1.1159.258.73 (424874035MwIUi8jFNCdaLfnJCrWig)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 28 Mar 2005 21:15:47 +0000 (21:15 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 28 Mar 2005 21:15:47 +0000 (21:15 +0000)
Fix cpu_relax/rep_nop to include a compiler barrier. This is needed
for SMP booting with gcc 4.0, for example.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/memory.c
xen/arch/x86/setup.c
xen/arch/x86/smp.c
xen/arch/x86/smpboot.c
xen/common/schedule.c
xen/include/asm-x86/processor.h

index 4c91d7374bb78f611a58a779979c9db8ba271701..e82f5aa8c818dd707f6051b208f8ba4a4cb13d55 100644 (file)
@@ -904,10 +904,7 @@ int get_page_type(struct pfn_info *page, u32 type)
         {
             /* Someone else is updating validation of this page. Wait... */
             while ( (y = page->u.inuse.type_info) == x )
-            {
-                rep_nop();
-                barrier();
-            }
+                cpu_relax();
             goto again;
         }
     }
index 6ef530c4e64ed450b89f4ff2c756141e47938092..1de2e2d71d310e55721a158cc1d2fceaf4bc073d 100644 (file)
@@ -452,10 +452,7 @@ static void __init start_of_day(void)
     smp_threads_ready = 1;
     smp_commence(); /* Tell other CPUs that state of the world is stable. */
     while ( wait_init_idle != 0 )
-    {
         cpu_relax();
-        barrier();
-    }
 #endif
 
     watchdog_on = 1;
index 65b126c1e9270b5310947bdd52479396d47101d0..120acaef002186711772fd9c2507a99c5b3f4ff0 100644 (file)
@@ -239,10 +239,7 @@ void flush_tlb_mask(unsigned long mask)
         flush_cpumask = mask;
         send_IPI_mask(mask, INVALIDATE_TLB_VECTOR);
         while ( flush_cpumask != 0 )
-        {
-            rep_nop();
-            barrier();
-        }
+            cpu_relax();
 
         spin_unlock(&flush_lock);
     }
@@ -260,10 +257,7 @@ void new_tlbflush_clock_period(void)
         flush_cpumask = ((1 << smp_num_cpus) - 1) & ~(1 << smp_processor_id());
         send_IPI_allbutself(INVALIDATE_TLB_VECTOR);
         while ( flush_cpumask != 0 )
-        {
-            rep_nop();
-            barrier();
-        }
+            cpu_relax();
         spin_unlock(&flush_lock);
     }
 
index f5aacca063a579635c3c4488645e9ceca0cbda53..e3e152bb496acc1f1152c4265770863d6732e0e3 100644 (file)
@@ -396,7 +396,7 @@ void __init start_secondary(void)
     smp_callin();
 
     while (!atomic_read(&smp_commenced))
-        rep_nop();
+        cpu_relax();
 
     /*
      * At this point, boot CPU has fully initialised the IDT. It is
index 9756b1851281774096b539c48ad7e5974b4e52cc..0470f9ee17b7e340fa2c6efd2021acbf7064c6be 100644 (file)
@@ -166,10 +166,7 @@ void domain_sleep(struct domain *d)
  
     /* Synchronous. */
     while ( test_bit(DF_RUNNING, &d->flags) && !domain_runnable(d) )
-    {
-        smp_mb();
         cpu_relax();
-    }
 }
 
 void domain_wake(struct domain *d)
index e3446aaeae5aecec4fa356fdf61c61fb32ddf9d1..00b3259f98e7959209e76c57b9b3df52f9653a05 100644 (file)
@@ -571,10 +571,10 @@ struct extended_sigtable {
 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
 static inline void rep_nop(void)
 {
-    __asm__ __volatile__("rep;nop");
+    __asm__ __volatile__ ( "rep;nop" : : : "memory" );
 }
 
-#define cpu_relax()    rep_nop()
+#define cpu_relax() rep_nop()
 
 /* Prefetch instructions for Pentium III and AMD Athlon */
 #ifdef         CONFIG_MPENTIUMIII